package com.woniu.mall.feign;

import com.woniu.common.entity.Result;
import com.woniu.mall.pojo.MallOrder;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "life-mall", path = "/mallOrder", contextId = "order")
public interface OrderFeignClient {

    @ApiOperation("根据订单号查询支付宝支付状态")
    @PostMapping("/checkPayStatus/{outTradeNo}")
    public Result checkPayStatus(@PathVariable(value = "outTradeNo") String outTradeNo);

    @ApiOperation("根据订单号获取订单信息")
    @PostMapping("/getOrderById/{outTradeNo}")
    public Result getOrderById(@PathVariable(value = "outTradeNo") String outTradeNo);

    @ApiOperation("修改订单信息")
    @PostMapping("/updateOrder")
    public Result updateOrder(@RequestBody MallOrder order);

    @ApiOperation("添加订单信息")
    @PostMapping("/addOrder")
    public Result addOrder(@RequestBody MallOrder order);
}
